home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20010306-20010921 / 000248_fdc@watsun.cc.columbia.edu_Fri Jul 6 09:50:36 EDT 2001.msg < prev    next >
Text File  |  2020-01-01  |  4KB  |  102 lines

  1. Article: 12573 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!fdc
  3. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: Any way to alter Kermit "quit" so I don't have to "kill?"
  6. Date: 6 Jul 2001 13:50:53 GMT
  7. Organization: Columbia University
  8. Lines: 85
  9. Message-ID: <9i4fnt$8jh$1@newsmaster.cc.columbia.edu>
  10. References: <h_417.5247$oa1.534611@newsread1.prod.itd.earthlink.net> <9i2n2o$dgn$1@newsmaster.cc.columbia.edu> <ORb17.6797$oa1.654216@newsread1.prod.itd.earthlink.net>
  11. NNTP-Posting-Host: watsun.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 994427453 8817 128.59.39.2 (6 Jul 2001 13:50:53 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 6 Jul 2001 13:50:53 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:12573
  16.  
  17. In article <ORb17.6797$oa1.654216@newsread1.prod.itd.earthlink.net>,
  18. Keith Doyle <keithuse@synco_pator.com> wrote:
  19. : ...
  20. : Though the shell does-- and that doesn't cause a disconnect.
  21. : Also, neither does this simple C program, run in place of the
  22. : kermit or lrz/lsz, so I'm inclined to doubt it's the close that's 
  23. : responsible for the disconnect:
  24. :
  25. When a program exits, all of its file descriptors are closed.
  26. If they were not open already by some other process, this is a
  27. "last close", and for serial ports, the driver sets DTR low.
  28. How that affects whatever is connected to the port depends on
  29. how that thing is configured - e.g. modems can be configured to
  30. ignore DTR.
  31.  
  32. When C-Kermit closes a serial port for which a SET MODEM TYPE
  33. (other than NONE or DIRECT) has been given, it also sends the
  34. modem's hangup command, e.g. ATH0, if MODEM HANGUP-METHOD is
  35. MODEM-COMMAND.  Use SET MODEM HANGUP-METHOD RS232-SIGNAL to undo
  36. this.
  37.  
  38. :     d = open("/dev/modem",O_RDWR);
  39. :
  40. This should make DTR come on.
  41.  
  42. :     sleep(4);
  43. :     close(d);
  44. :
  45. This should make DTR go off.
  46.  
  47. :     exit (0);
  48. :
  49. And if that didn't, this should.
  50.  
  51. : 7. Kermit will warn you there may be an active connection, and ask you if
  52. :    you still want to exit.  Your choice is to either not-exit or say yes
  53. :    you want to exit at which point it disconnects the line.  I believe if
  54. :    it just did a "close" and then an "exit" here things would be ok, but
  55. :    more is going on.
  56. :
  57. You can avoid the warning with SET EXIT WARNING OFF.
  58.  
  59. : >Try the first method (-l 0) and see what happens.  If that doesn't work,
  60. : >what I'd recommend is to let Kermit handle everything -- dialing, terminal
  61. : >session, and file transfer.  That's what it's designed for.
  62. : That may be what it's designed for, but I already have an exceedingly
  63. : complex program that originally used zmodem that I'm not going to rewrite
  64. : from scratch in a specialized script language I would have to learn 
  65. : special for that one purpose...
  66. :
  67. Don't blame us for a "specialized script language".  It predates all your
  68. other favorite ones except maybe Bourne shell and DCL, and it's also probably
  69. more portable.
  70.  
  71. , when all I need is something that 
  72. : implements the protocol without mucking with the connection-- I just want 
  73. : to plug in a replacement protocol without rewriting the whole schmeer.
  74. :
  75. Then use G-Kermit instead of C-Kermit:
  76.  
  77.   http://www.columbia.edu/kermit/gkermit.html
  78.  
  79. You can think of G-Kermit as Kermit's answer to lrz/lsz.  It transfers
  80. files over stdio, which it does not open or close, and can be redirected.
  81. See the description of the -X option.
  82.  
  83. : If there's a way to make the FD approach work, it's worth investigating
  84. : further.  I presume it should work, but there's something I must not be
  85. : doing right to set it up.  I'll try it a little more and report back more
  86. : specific on what I tried and how it acts.  Thanks for the response-- I do
  87. : get the idea that kermit in general is a far more sophisticated program than
  88. : zmodem (certainly way more robust a protocol) but I must admit I rather like
  89. : the modularity of keeping the protocol separate from the scripting...
  90. This is the UNIX philosophy, but of course Kermit software (including
  91. C-Kermit) is not just for UNIX.  Anyway, experience shows that automating
  92. complex communications tasks works better with an integrated script engine
  93. than by, say, grafting 'expect' onto 'telnet' or 'cu' or 'ftp' or whatever.
  94. For a brief discussion of this idea (as it applies to FTP) see:
  95.  
  96.   http://www.columbia.edu/kermit/ftpscript.html
  97.  
  98. - Frank
  99.